from Zk.Zk3.Base.Base import Base
from selenium.webdriver.common.by import By
import time
class Page(Base):
    # 点击请登录按钮
    headerLogin_loc=(By.CLASS_NAME,'headerLogin')
    def headerLogin(self):
        self.click(self.headerLogin_loc)
    dydenglu=(By.XPATH,'//*[@id="loginform"]/div/div/div/div/div[1]/div[1]/a[1]')
    # 断言1：账号登录
    def dy1(self):
        self.text(self.dydenglu)
    # 输入账号
    username_loc=(By.ID,'userName')
    def username(self):
        self.send_keys(self.username_loc,'13012558376')
#     输入密码
    password_loc=(By.ID,'password')
    def password(self):
        self.send_keys(self.password_loc,'123456Aa')
#     点击登录按钮
    login_loc=(By.ID,'save')
    def login(self):
        self.click(self.login_loc)
#     点击二次确认按钮
    queren_loc=(By.ID,'bindSub')
    def queren(self):
        self.click(self.queren_loc)

    def test_jiuxian_login(self):
        self.headerLogin()
        # time.sleep(3)
        # print("断言1：账号登录：",self.dy1())
        time.sleep(2)
        self.username()
        self.password()
        time.sleep(8)
        self.login()
        self.queren()
        time.sleep(5)

